package com.demo.project_template.controller;

import com.demo.project_template.entity.SystemConfig;
import com.demo.project_template.service.SystemConfigService;
import com.demo.project_template.vo.response.R;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * <p>
 * 系统配置 前端控制器
 * </p>
 * @author 杨玉龙
 * @since 2023-06-19 15:56:44
 */
@Api(tags = "系统配置模块")
@RestController
@RequestMapping("/systemConfig")
public class SystemConfigController {
    @Resource
    private SystemConfigService systemConfigService;

    @ApiOperation("查询系统配置")
    @GetMapping("/selectSystemConfig")
    public R selectSystemConfig(){
        return R.success(systemConfigService.selectSystemConfig());
    }

    @ApiOperation("修改系统配置")
    @PostMapping("/updateSystemConfig")
    public R updateSystemConfig(@RequestBody SystemConfig systemConfig){
        systemConfigService.updateSystemConfig(systemConfig);
        return R.success();
    }

}
